package online.lmds.sdmanage.main.device.controller;

import online.lmds.sdmanage.common.Constants;
import online.lmds.sdmanage.common.entity.Page;
import online.lmds.sdmanage.main.device.entity.Device;
import online.lmds.sdmanage.main.device.entity.RunLog;
import online.lmds.sdmanage.main.device.service.RunLogService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.xml.crypto.Data;
import java.util.Date;

/**
 * Created by Brighten Ma on 2017/5/29.
 */

@Controller
@RequestMapping("/runLog")
public class RunLogController {

    @Resource(name = "RunLogService")
    private RunLogService runLogService;


    @RequestMapping(value = "/listBetweenDate")
    @ResponseBody
    public Object listByUser(RunLog runLog, Long startDate, Long endDate) {

        Date start = null;
        Date end = null;

        if (startDate != null) {
            start = new Date(startDate);
        }
        if (endDate != null) {
            end = new Date(endDate);
        }
        return runLogService.listBetweenDate(runLog, start, end);
    }

}
